Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: support JSON for builtin function COALESCE #9087

Merged
merged 6 commits into from
Jan 28, 2019

Conversation

zz-jason
Copy link
Member

Signed-off-by: Jian Zhang [email protected]

What problem does this PR solve?

Support JSON type for builtin function COALESCE, to avoid panic once we returned a nil pointer.

What is changed and how it works?

As the above said.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

@zz-jason
Copy link
Member Author

/run-all-tests

@eurekaka
Copy link
Contributor

@zz-jason CI failed, PTAL

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix ci.

expression/integration_test.go Outdated Show resolved Hide resolved
@@ -202,6 +202,9 @@ func (c *coalesceFunctionClass) getFunction(ctx sessionctx.Context, args []Expre
}
sig = &builtinCoalesceDurationSig{bf}
sig.setPbCode(tipb.ScalarFuncSig_CoalesceDuration)
case types.ETJson:
sig = &builtinCoalesceJsonSig{bf}
sig.setPbCode(tipb.ScalarFuncSig_CoalesceJson)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update getSignatureByPB as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSignatureByPB is only used in mocktikv when this function is pushed to the coprocessor. I think we can do it later when we push it?

expression/builtin_compare.go Outdated Show resolved Hide resolved
@zz-jason
Copy link
Member Author

/run-all-tests

@codecov-io
Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #9087 into master will decrease coverage by 0.01%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9087      +/-   ##
==========================================
- Coverage   67.21%   67.19%   -0.02%     
==========================================
  Files         371      371              
  Lines       76945    76958      +13     
==========================================
- Hits        51721    51715       -6     
- Misses      20606    20622      +16     
- Partials     4618     4621       +3
Impacted Files Coverage Δ
expression/builtin_compare.go 73.9% <69.23%> (+0.1%) ⬆️
util/systimemon/systime_mon.go 80% <0%> (-20%) ⬇️
ddl/delete_range.go 75.13% <0%> (-5.3%) ⬇️
store/tikv/scan.go 73.94% <0%> (-3.37%) ⬇️
executor/index_lookup_join.go 77.28% <0%> (-0.64%) ⬇️
store/tikv/lock_resolver.go 42.65% <0%> (+0.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7648317...a803afe. Read the comment docs.

Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eurekaka eurekaka added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 28, 2019
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 28, 2019
@zz-jason zz-jason merged commit 6dcba1f into pingcap:master Jan 28, 2019
@zz-jason zz-jason deleted the bugfix/coalesce-json branch January 28, 2019 03:34
zz-jason added a commit to zz-jason/tidb that referenced this pull request Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants